home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d12 / jazlib.arc / JZSTRCAT.C < prev    next >
Text File  |  1988-12-18  |  1KB  |  36 lines

  1.  
  2. /*
  3. ┌────────────────────────────────────────────────────────────────────────────┐
  4. │jzstrcat.c                                     │
  5. │Concatenate multiple strings together in one function call using a variable │
  6. │number of parameters.                                 │
  7. │Simply put a null string (0) as the last argument in the function.         │
  8. │Synopsis:                                     │
  9. │  char *wdir,wstr[255];                             │
  10. │                                         │
  11. │  *wdir = "MSC";                                                            │
  12. │  *wstr=0;                                     │
  13. │                                         │
  14. │  jzstrcat(wstr,"\\",wdir,"\\","JAZ",0);                                    │
  15. │                                         │
  16. │  (wstr now equals "\MSC\JAZ")                                              │
  17. └────────────────────────────────────────────────────────────────────────────┘
  18. */
  19.  
  20. jzstrcat(fstr,fparm)
  21. char *fstr;
  22. char *fparm;
  23. {
  24.  
  25.   int w;
  26.  
  27.   /**
  28.    ** We are going to loop through the addresses of the parmameters.
  29.    ** Effectively looking at our arguments on the stack
  30.    **/
  31.  
  32.   for (w = 0 ; *(&fparm + w) ; w ++) /* until we hit a null string */
  33.     strcat(fstr,*(&fparm + w)); /* reference the address of the parms */
  34.  
  35. }
  36.